add dtr control to Serial constructor #266
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What:
Add Data-Terminal-Ready (DTR) control parameter to the Serial constructor.
Why:
To set the default in the constructor. The arduino IDE and pyserial lib both provide constructor arguments for setting the default DTR behaviour of a serial object without needing to make external calls to update the properties of a file handle after construction. This is desirable behaviour.
Solves #265
How:
dtrcontrol_tenum with valuesdtr_disable,dtr_enable, anddtr_handshake.dtr_handshakeis non-functional.dtrcontrol_t dtrcontrol_field toSerialImpl.Serial::setDTR()andSerialImpl::setDTR()bool parameters withdtrcontrol_tparameters.SerialImpl::dtrcontrol_to parameter value ofSerialImpl::setDTR()inSerialImpl::setDTR().SerialImpl::reconfigurePort()depending on the value ofSerialImpl::dtrcontrol_.dtrcontrol_tconstructor arguments for bothSerialandSerialImplconstructors.Serialconstructor parameter value ofdtrcontrol_tisdtr_disable.These changes are made to both windows and unix implementations.
If something is not satisfactory, please let me know and I will make adjustments.
- Maxine